package br.ucb.sigplan.controller;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

public class ActionPool {
	private static Properties acoes;
	private static ActionPool pool;
	
	public static ActionPool getInstance (){
		if (pool == null)
			pool = new ActionPool();
		
		return pool;
	}
	
	public void carregaAcoes (String nomeArquivo){
		
		if (acoes == null)
			acoes = new Properties();
		InputStream input = getClass().getClassLoader().getResourceAsStream(nomeArquivo);
		
		try {
			acoes.load(input);
		} catch (IOException e) {
			
			e.printStackTrace();
		}
	}
	
	public String getAcao(String nome) {
		return acoes.getProperty(nome);
	}

	

}
